const http = require('http');
const fs = require('fs');
const server = http.createServer(function (req, res) {
    let { url } = req;
    res.write(url);
    // 写入
    fs.writeFileSync('./log.txt', 'req.toString()', (err, data) => {
        if (err) {
            s
            console.log('文件写入失败');
        } else {
            console.log('文件写入成功');
        }
    })
    res.end()
});

server.listen(8090, () => {
    console.log('监听8090');
})
